//
//  BuyerShareTableViewCell.m
//  XinKaiFa55like
//
//  Created by 55like on 2017/9/25.
//  Copyright © 2017年 55like lj. All rights reserved.
//

#import "BuyerShareTableViewCell.h"

@implementation BuyerShareTableViewCell


-(void)setListsModel:(BuyerShareListsModel *)listsModel{
    
    
    [self.acceptBtn setTitle:listsModel.ctime forState:UIControlStateNormal];
    self.titleLab.text = listsModel.name;
    self.deslab.text = listsModel.companyname;
    
    self.acceptBtn.frame = CGRectMake(kScreenWidth - 10 - [listsModel.ctime widthWithFont:14], (self.frameHeight - 20)/2, [listsModel.ctime widthWithFont:14], 20);
    self.titleLab.frame = CGRectMake(20, 10, X(self.acceptBtn) - 20 - 10, 12);
    self.deslab.frame = CGRectMake(20, YH(self.titleLab) + 8, self.titleLab.frameWidth, 10);
    
    
}
-(void)setListModel:(BuyerShareListModel *)listModel{
    
    
    [self.acceptBtn setTitle:listModel.ctime forState:UIControlStateNormal];
    self.titleLab.text = listModel.name;
    self.deslab.text = listModel.companyname;

    self.acceptBtn.frame = CGRectMake(kScreenWidth - 10 - [listModel.ctime widthWithFont:14], (self.frameHeight - 20)/2, [listModel.ctime widthWithFont:14], 20);
    self.titleLab.frame = CGRectMake(20, 10, X(self.acceptBtn) - 20 - 10, 12);
    self.deslab.frame = CGRectMake(20, YH(self.titleLab) + 8, self.titleLab.frameWidth, 10);
    
    
}


-(UILabel *)titleLab{
    
    if (!_titleLab) {
        
        UILabel * lab = [[UILabel alloc]init];
        lab.textColor = rgbTitleDeepGray;
        lab.font = Font(15);
        lab.textAlignment = NSTextAlignmentLeft;
        [self addSubview:lab];
        _titleLab = lab;
        
    }
    
    return _titleLab;
}
-(UILabel *)deslab{
    
    if (!_deslab) {
        UILabel * lab = [[UILabel alloc]init];
        lab.textColor = rgbTxtGray;
        lab.font = Font(14);
        lab.textAlignment = NSTextAlignmentLeft;
        [self addSubview:lab];
        _deslab = lab;
    }
    return _deslab;
}
-(UIButton *)acceptBtn{
    
    if (!_acceptBtn) {
        
        UIButton * butt = [[UIButton alloc]init];
        butt.titleLabel.font = Font(14);
        butt.userInteractionEnabled = NO;
        [butt setTitleColor:rgbTxtGray forState:UIControlStateNormal];
        [self addSubview:butt];
        _acceptBtn = butt;
    }
    
    return _acceptBtn;
}

@end
